#include<iostream>

using namespace std;
int sum;
int main()
{
	int x;
	cin >> x;
	for (int i = 1; i <= x; i++)
	{
		if (x % i == 0) sum += i;
	}
	std::cout << sum << std::endl;
	
	
	return 0;
}
